package com.bjpowernode.app;
import java.io.File;
public class MyApp3 {
    public static void main(String[] args) {
        //对文件夹的遍历
        String path = "D:\\Nwt";
        File file = new File(path);
        //文件是否存在
        if (file.exists() && file.isDirectory()) {
            //给出子文件或者子文件夹
            File[] files = file.listFiles();
            for (File fileTemp : files) {
                if(fileTemp.isDirectory()){
                    System.out.println("dxx-xxx-xxx "+fileTemp.getAbsolutePath());
                }
                else {
                    System.out.println("fxx-xxx-xxx "+fileTemp.getAbsolutePath());
                }

            }
        }
    }
}
